/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package praktikum_2.percobaan_1;

/**
 *
 * @author Liem
 */
public class Vehicle1 {
    double load,maxLoad;
    
    public Vehicle1 (double max){
        this.maxLoad = max;
    }
    
    public double getLoad (){
        return this.load;
    }
    
    public double getMaxLoad(){
        return this.maxLoad;
    }
    
    public boolean addBox (double weight) {
        double temp = 0.0D;
        temp = this.load + weight;
        
        if(temp <= maxLoad){
            this.load = this.load + weight;
            return true;
        }
        else
        {
            return false;
        }
        
    }
}
